package hx.front.manager.editor;

import hx.engine.implementation.PersonalityEngine;
import hx.front.manager.ManagerAction;
import hx.model.dto.House;
import hx.model.dto.Personality;
import hx.model.dto.Role;
import hx.model.dto.User;

import org.apache.log4j.Logger;

/**
 * Tareas de mantenimiento de un único personaje previamente filtrado. Alta,
 * edición y borrado.
 * 
 * @author kineas
 *
 */
public class PersonalityEditor extends ManagerAction {

	private static final long serialVersionUID = 1L;
	
	private Logger log = Logger.getLogger(PersonalityEditor.class);
	
	private PersonalityEngine personalityEngine;
	private Role role;
	private House house;
	private User user;
	private Integer status;
	private Integer influence;
	private String name;
	private String completeName;
	
	
	@Override
	protected void fillForm(String id) {
		log.info(PRE_LOAD);
		
		Personality pj = personalityEngine.getById(id);
		setCompleteName(pj.getCompleteName());
		setHouse(pj.getHouse());
		setInfluence(pj.getInfluence());
		setName(pj.getName());
		setRole(pj.getRole());
		setStatus(pj.getStatus());
		setUser(pj.getUser());
		
		log.info(POST_LOAD);
	}

	@Override
	protected void loadCollections() throws Exception {
		// TODO Auto-generated method stub
	}

	@Override
	public String updateCreate() throws Exception {
		// TODO: Actualizar o crear una personalidad para un jugador
		return null;
	}

	// GETTERS AND SETTERS
	
	public PersonalityEngine getPersonalityEngine() {
		return personalityEngine;
	}

	public void setPersonalityEngine(PersonalityEngine personalityEngine) {
		this.personalityEngine = personalityEngine;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}

	public House getHouse() {
		return house;
	}

	public void setHouse(House house) {
		this.house = house;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public Integer getInfluence() {
		return influence;
	}

	public void setInfluence(Integer influence) {
		this.influence = influence;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getCompleteName() {
		return completeName;
	}

	public void setCompleteName(String completeName) {
		this.completeName = completeName;
	}
	
}
